Ext.define('carManage.view.carInfo.GridList', {
    extend: 'Ext.grid.Panel',
    store: 'CarInfoStore',
    alias: 'widget.gridList',
    selModel: Ext.create('Ext.selection.CheckboxModel', {mode: "SIMPLE"}),
    initComponent: function() {
        this.columns = [
            {
                header: '编号',
                sortable: true,
                hidden: true,
                dataIndex: 'id'
            }, {
                header: '车牌号码',
                sortable: true,
                hidden: false,
                width: 95,
                dataIndex: 'code'
            }, {
                header: '资产属性',
                sortable: true,
                width: 100,
                dataIndex: 'attributes'
            }, {
                header: '车辆类型',
                sortable: true,
                width: 164,
                dataIndex: 'type'
            }, {
                header: '车辆原值(万)',
                sortable: true,
                width: 90,
                dataIndex: 'price'
            }, {
                header: '品牌',
                sortable: true,
                width: 100,
                dataIndex: 'brand'
            }, {
                header: '排量',
                sortable: true,
                width: 60,
                dataIndex: 'displacement'
            }, {
                header: '购买日期',
                sortable: true,
                width: 100,
                dataIndex: 'purchase_date'
            }, {
                header: '使用日期',
                sortable: true,
                width: 100,
                dataIndex: 'use_date'
            }, {
                header: '产权单位',
                sortable: true,
                width: 165,
                dataIndex: 'company'
            }, {
                header: '使用部门',
                sortable: true,
                width: 115,
                dataIndex: 'department'
            }, {
                header: '制造商',
                sortable: true,
                width: 190,
                dataIndex: 'manufacturer'
            }, {
                header: '驾驶员姓名',
                sortable: true,
                width: 96,
                dataIndex: 'driver'
            }, {
                header: '是否使用公司标识',
                sortable: true,
                width: 125,
                dataIndex: 'logo',
                renderer: function(v) {
                    if (v === "1") {
                        return "是";
                    } else if (v === "2") {
                        return "否";
                    }
                }
            }, {
                header: '是否安装GPS',
                sortable: true,
                width: 115,
                dataIndex: 'gps',
                renderer: function(v) {
                    if (v === "1") {
                        return "是";
                    } else if (v === "2") {
                        return "否";
                    }
                }
            }, {
                header: '状态',
                sortable: true,
                width: 115,
                dataIndex: 'states',
                renderer: function(v) {
                    if (v === "1") {
                        return "运行";
                    } else if (v === "2") {
                        return "报废";
                    }else if (v === "3") {
                        return "待报废";
                    }
                }
            },{
                header: '车辆用途',
                hidden: true,
                sortable: true,
                dataIndex: 'vehicleuse'
            }
        ];
        this.callParent(arguments);
    }
});